package com.itheima01.day04;

public class ArrayTest02 {
    public static void main(String[] args) {
        int[] arr1 = {63, 68, 39, 44, 8, 9, 4, 15};
        int[] arr2 = {150, 150, 163, 171, 128, 130, 81, 168};
        int max1 = arr1[0];
        int min1 = arr1[0];
        int max2 = arr2[0];
        int min2 = arr2[0];
        for (int i = 0; i < arr1.length; i++) {
            if (arr1[i] > max1) {
                max1 = arr1[i];
            } else if (arr1[i] < min1) {
                min1 = arr1[i];
            }
        }
        for (int i = 0; i < arr2.length; i++) {
            if (arr2[i] > max2) {
                max2 = arr2[i];
            } else if (arr2[i] < min2) {
                min2 = arr2[i];
            }
        }
        System.out.println("数组1的最大值为:" + max1);
        System.out.println("数组1的最小值为:" + min1);
        System.out.println("数组2的最大值为:" + max2);
        System.out.println("数组2的最小值为:" + min2);
    }
}



